home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 November: Tool Chest / Dev.CD Nov 94.toast / Sample Code / Snippets / Development Tools & Languages / DTSCPlusLibrary / Sources / AppleEvent.h < prev    next >
Encoding:
Text File  |  1993-01-14  |  2.9 KB  |  83 lines  |  [TEXT/MPS ]

  1. /* _________________________________________________________________________________________________________ //
  2.   Copyright © 1992 Apple Computer, Inc. All rights reserved.
  3.   Macintosh Developer Technical Support.C++ Macintosh Toolbox Framework.
  4.   Date: 11/22/92
  5.   Programmer: Kent Sandvik
  6.   Revision comments are at the end of this file.
  7.   ---
  8.   TAppleEvent is an Apple Event class that will send and receive Apple Events.
  9.   AppleEvent.cp contains the TAppleEvent class definition.
  10.   _________________________________________________________________________________________________________ */
  11.  
  12. // Declare label for this header file
  13. #ifndef _APPLEEVENT_
  14. #define _APPLEEVENT_
  15.  
  16. #ifndef _DTSCPLUSLIBRARY_
  17. #include "DTSCPlusLibrary.h"
  18. #endif
  19.  
  20. //    Toolbox Include Files
  21. #ifndef __PROCESSES__
  22. #include <Processes.h>
  23. #endif
  24.  
  25. #ifndef __APPLEEVENTS__
  26. #include <AppleEvents.h>
  27. #endif
  28.  
  29.  
  30. // _________________________________________________________________________________________________________ //
  31. //    TAppleEvent Class Interface
  32. class TAppleEvent
  33. // The TAppleEvent class will provide Apple Event services (send, receive, get and put
  34. // descriptor information.
  35. {
  36. public:
  37.     // CONSTRUCTORS AND DESTRUCTORS
  38.     TAppleEvent();                                // create a kCurrentProcess AE
  39.     TAppleEvent(OSType signature);                // create an AE based on the OSType address
  40.     ~TAppleEvent();                                // default destructor
  41.  
  42.     void Initialize();                            // initialize fields to known values
  43.  
  44.     //    MAIN INTERFACES
  45.     virtual OSErr Define(AEEventClass theClass,
  46.                          AEEventID ID);            // create the actual AE
  47.     virtual OSErr Send();                        // fire off the Apple Event
  48.     virtual OSErr Send(AEEventClass theClass,
  49.                        AEEventID ID);            // fire off with the specs
  50.     virtual void SetAddress(const AEAddressDesc address);// set address for our AE
  51.  
  52.     //    GET/SET MEMBER FUNCTIONS
  53.     virtual long GetTimeoutValue() const;        // get our timeout value
  54.     virtual void SetTimeoutValue(const long val);// set out timeout value
  55.     virtual AESendMode GetSendingMode() const;    // get our sending mode
  56.     virtual void SetSendingMode(const AESendMode mode);// set our sending mode    
  57.     virtual AESendPriority GetPriority() const;    // get our priority setting
  58.     virtual void SetPriority(const AESendPriority value);// set our priority setting        
  59.  
  60.     //    FIELDS
  61. protected:
  62.     OSErr fError;                                // current error 
  63.     OSType fSignature;                            // keep track of the OSType used
  64.     AEAddressDesc fTarget;                        // needed data structure for AEs
  65.     AppleEvent fAE;                                // the final Apple Event itself
  66.     AppleEvent fReply;                            // the reply AE
  67.     AESendPriority fPriority;                    // priority mode
  68.     AESendMode fSendMode;                        // our send mode field
  69.     long fTimeout;                                // timeout (in ticks)
  70. };
  71.  
  72. #endif
  73.  
  74. // _________________________________________________________________________________________________________ //
  75.  
  76.  
  77. /*    Change History (most recent last):
  78.   No        Init.    Date        Comment
  79.   1            khs        11/22/92    New file
  80.   2            khs        1/7/93        Cleanup
  81. */
  82.  
  83.